<!DOCTYPE html>
<html>
<head>
<title>菜单管理-添加</title>
#@head()
</head>

<body class="gray-bg">
	<div class="wrapper-content ">
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-content">

					<form class="form-horizontal" role="form" method="post" onsubmit="return formSubmit();">
						<div class="form-group">
							<label for="firstname" class="col-sm-3 control-label">上级菜单：</label>
							<div class="col-sm-8">
								<input id="" name="" class="form-control" type="text" value="#(parent.name)" readonly> <input name="bean.parentId" type="hidden" value="#(parent.id)">
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label">类型</label>
							<div class="col-sm-8 i-checks">
								#for(item : typeList)
								<label class="radio-inline"> 
									<input type="radio" name="bean.type" value="#(item.value)" #if(parent.type==item.value) checked="checked" #end> #(item.name)
								</label> 
								#end
							</div>
						</div>

						<div class="form-group">
							<label for="firstname" class="col-sm-3 control-label">编码</label>
							<div class="col-sm-8">
								<input type="text" class="form-control" name="bean.code" value="" placeholder="请输入编码">
							</div>
						</div>

						<div class="form-group">
							<label for="firstname" class="col-sm-3 control-label">名称</label>
							<div class="col-sm-8">
								<input type="text" class="form-control" name="bean.name" value="" placeholder="请输入名称">
							</div>
						</div>

						<div class="form-group">
							<label for="firstname" class="col-sm-3 control-label">URL</label>
							<div class="col-sm-8">
								<input type="text" class="form-control" name="bean.url" value="" placeholder="请输入URL">
							</div>
						</div>

						<div class="form-group">
							<label for="firstname" class="col-sm-3 control-label">权限</label>
							<div class="col-sm-8">
								<input type="text" class="form-control" name="bean.perms" value="" placeholder="请输入权限">
							</div>
						</div>

						<div class="form-group">
							<label for="firstname" class="col-sm-3 control-label">菜单图标</label>
							<div class="col-sm-8">
								<input type="text" class="form-control" name="bean.icon" value="" placeholder="请输入菜单图标">
							</div>
						</div>

						<div class="form-group">
							<label for="firstname" class="col-sm-3 control-label">排序</label>
							<div class="col-sm-8">
								<input type="number" class="form-control" name="bean.orderNum" value="" placeholder="请输入排序">
							</div>
						</div>

						<div class="form-group">
							<div class="col-sm-offset-3 col-sm-8">
								<button type="submit" class="btn btn-success">提交</button>
								<button type="button" class="btn default" onclick="cancel();">取消</button>
							</div>
						</div>

					</form>

				</div>
			</div>
		</div>
	</div>
</body>
#@footer()

<script type="text/javascript">
function formSubmit(){
	var param = $('form').serialize();
	$.post('save',param,function(res){
		if(res.code==0){
			//注意：parent 是 JS 自带的全局对象，可用于操作父页面
			var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
			parent.layer.close(index);
			parent.layer.msg(res.msg,{time:1000},function(){
				parent.reLoad()();
			});
		}
	})
	return false;
}
function cancel(){
	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
	parent.layer.close(index);
}
</script>

</html>
